<?php

class spFormContainer extends spDiv
{
	private $data;
	private $form;
	
	public function __construct( $data=null )
	{
		parent::__construct();
		
		$this->data = $data;
		
		$title = isset($data["title"])?$data["title"]:"";
		$name = isset($data["name"])?$data["name"]:"";
		$action = isset($data["action"])?$data["action"]:"";		
		
		$table = new spTableExt;
		$table->addStyle( "table-layout", "fixed" );
		$table->setHeader( array($title) );
		parent::addChild( $table );
		
		$this->form = new spForm;
		$this->form->setClass( "formContainer" );
		$this->form->addAttr( "name", $name );
		$this->form->addAttr( "action", $action );
		$this->form->addAttr( "method", "post" );
	//	$this->form->addAttr( "enctype", "multipart/form-data" );
		$table->addRowChilds( array($this->form) );
	}
	
	public function getForm()
	{
		return $this->form;
	}
	
}

?>